import {reactive} from "vue";
import type {Category} from "@/types/categories";
import type {Goods} from "@/types/goods";


const categoryState = reactive<{
    categories?: Category.Dto[];
}>({
    categories: []
});
const state = reactive<{
    title?: string;
    category_id?: number;
}>({
    title: "",
    category_id: 0,
});

const goodsState = reactive(<{
    sales: { list: Goods.Dto[], page: number };
    price: { list: Goods.Dto[], page: number };
    recommend: { list: Goods.Dto[], page: number };
    comments_count: { list: Goods.Dto[], page: number };
    currentType:string;
}>({
    sales: {list: [], page: 1},
    price: {list: [], page: 1},
    recommend: {list: [], page: 1},
    comments_count: {list: [], page: 1},
    currentType:'sales',
}));


export {state, goodsState, categoryState};